﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ManageSlide.ascx.cs" Inherits="NLLSite.Administrator.UserControl.ManageSlide" %>
<style type="text/css">
    .style2
    {
        width: 150px;
    }
    .style1
    {
        width: 383px;
    }
</style>
<script type="text/javascript" src="../../ckfinder/ckfinder.js"></script>
<script type="text/javascript">

    function BrowseServer() {
        var finder = new CKFinder();
        finder.basePath = '../../ckfinder/';
        finder.selectActionFunction = SetFileField;
        finder.popup();
    }
    function SetFileField(fileUrl) {
        document.getElementById('ctl00_ContentPlaceHolderCenter_ManageSlide1_Txtimgslide').value = fileUrl;
        //Element ID = Ten class usercontrol + 1 + ID cua text box. ctl00_ContentPlaceHolderCenter_


    }

</script>
<script type="text/javascript">

    function BrowseServer1() {

        var finder = new CKFinder();
        finder.basePath = '../../ckfinder/';
        finder.selectActionFunction = SetFileField1;
        finder.popup();
    }

    function SetFileField1(fileUrl) {
        document.getElementById('ctl00_ContentPlaceHolderCenter_ManageSlide1_TxtimgThb').value = fileUrl;
    }

</script>
<div class="box box-100">
    <div class="boxin">
        <div class="header">
            <h3>
                Quản lý Slide</h3>
        </div>
        <div style="padding: 18px;">
            <!--<form class="basic" action="" method="post" enctype="multipart/form-data"><!-- Default basic forms -->
            <div class="inner-form">
    <asp:Panel ID="Panel1" runat="server" Visible="False">
        <div>
            Thêm mới Slide</div>
        <div>
            <table style="width:100%;">
                <tr>
                    <td class="style2">
                        Ảnh Trên Slide :</td>
                    <td class="style1">
                        <asp:TextBox ID="Txtimgslide" runat="server" Width="250px"></asp:TextBox>
                        &nbsp;<input type="button" value="Browse" onclick="BrowseServer();" 
                                style="width: 96px" class="altbutton" id="btn1" /></td>
                    <td>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                    ControlToValidate="Txtimgslide" ErrorMessage="*" ValidationGroup="1"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td class="style2">
                        Ảnh Tiêu Đề :</td>
                    <td class="style1">
                        <asp:TextBox ID="TxtimgThb" runat="server" Width="250px"></asp:TextBox>
                        &nbsp;<input type="button" value="Browse" onclick="BrowseServer1();" 
                                style="width: 96px" class="altbutton" id="btn2" /></td>
                    <td>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                    ControlToValidate="TxtimgThb" ErrorMessage="*" ValidationGroup="1"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td class="style2">
                        Mô Tả :</td>
                    <td class="style1">
                        <asp:TextBox ID="Txtdes" runat="server" Height="71px" TextMode="MultiLine" 
                    Width="250px"></asp:TextBox>
                    </td>
                    <td>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                    ControlToValidate="Txtdes" ErrorMessage="*" ValidationGroup="1"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td class="style2">
                        Đường Dẫn :</td>
                    <td class="style1">
                        <asp:TextBox ID="Txtlink" runat="server" Width="250px"></asp:TextBox>
                    </td>
                    <td>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                    ControlToValidate="Txtlink" ErrorMessage="*" ValidationGroup="1"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td class="style2">
                        Tình Trạng :</td>
                    <td class="style1">
                        <asp:CheckBox ID="Cbxsta" runat="server" />
                    </td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style2">
                        <asp:Label ID="lblchk" runat="server"></asp:Label>
                    </td>
                    <td class="style1">
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style2">
                        &nbsp;</td>
                    <td class="style1">
                        <asp:Button ID="Button3" runat="server" onclick="Button3_Click" 
                    Text="Cập Nhật" ValidationGroup="1" />
                        &nbsp;
                        <asp:Button ID="Button4" runat="server" onclick="Button4_Click" 
                    Text="Thiết Lập Lại" />
                    </td>
                    <td>
                        &nbsp;</td>
                </tr>
            </table>
        </div>
    </asp:Panel>
</div>
<div>
    <asp:Panel ID="Panel2" runat="server">
        <br />
        <asp:CheckBox ID="Cbxdele" runat="server" AutoPostBack="True" 
            oncheckedchanged="Cbxdele_CheckedChanged" />
        &nbsp;<asp:Button ID="BtnDele" runat="server" onclick="BtnDele_Click" Text="Xóa" />
        &nbsp;<asp:Button ID="Button5" runat="server" onclick="Button5_Click" 
            Text="Thêm mới" />
&nbsp;<asp:GridView ID="GridView1" runat="server" 
    AutoGenerateColumns="False" CellPadding="4" DataKeyNames="ID" 
    DataSourceID="LinqDataSource1" EnableModelValidation="True" 
    GridLines="None" Width="920px" AllowPaging="True" AllowSorting="True" 
            onselectedindexchanged="GridView1_SelectedIndexChanged" 
            ForeColor="#333333">
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
            <Columns>
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:CheckBox ID="Cbx" runat="server" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" 
                    ReadOnly="True" SortExpression="ID" Visible="False" />
                <asp:BoundField DataField="Description" HeaderText="Mô Tả" 
                    SortExpression="Description" />
                <asp:CheckBoxField DataField="Status" HeaderText="Hiển Thị" 
                    SortExpression="Status" />
                <asp:BoundField DataField="Link" HeaderText="Link Ảnh" SortExpression="Link" />
                <asp:CommandField SelectText="Sửa" ShowSelectButton="True" />
                <asp:TemplateField HeaderText="anhslide" Visible="False">
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Eval("SlideImage") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="anhtieude" Visible="False">
                    <ItemTemplate>
                        <asp:Label ID="Label2" runat="server" Text='<%# Eval("ThumbImage") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <EditRowStyle BackColor="#999999" />
            <FooterStyle BackColor="#5D7B9D" ForeColor="White" Font-Bold="True" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" 
        ForeColor="White" />
            <PagerStyle BackColor="#284775" ForeColor="White" 
        HorizontalAlign="Center" />
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" 
        ForeColor="#333333" />
        </asp:GridView>
        <asp:LinqDataSource ID="LinqDataSource1" runat="server" 
    ContextTypeName="DAL_Class.NLLDataContext" TableName="SLIDEs">
        </asp:LinqDataSource>
    </asp:Panel>
</div>
</div>
</div>


